package com.lilicould.dao;

import com.lilicould.entity.ScheduleDetails;
import com.lilicould.entity.Schedules;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ScheduleDao {
    // 根据教师工号获取指定的课程信息
    @Select("SELECT * FROM schedule_details_view WHERE teacher_user_no = #{teacherUserNo}")
    List<ScheduleDetails> getSchedulesByTeacherUserNo(String teacherUserNo);

    // 获取所有课程安排
    @Select("SELECT * FROM schedule_details_view")
    List<ScheduleDetails> getAllSchedules();

    // 添加课程安排
    int addSchedule(Schedules schedule);

    // 删除课程安排
    @Delete("DELETE FROM schedules WHERE id = #{id}")
    int deleteSchedule(int id);

}
